﻿<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ModernControls="clr-namespace:ModernControls"
xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
xmlns:shell="clr-namespace:Microsoft.Windows.Shell;assembly=Microsoft.Windows.Shell"
xmlns:System="clr-namespace:System;assembly=mscorlib"
>
    <!--Theme Colors-->
    <Color x:Key="AppBaseColor" R="24" G="173" B="88" A="255"/>
    <Color x:Key="AppBaseLightColor" R="85" G="200" B="135" A="255"/>
    <Color x:Key="AppBaseLightestColor" R="222" G="246" B="232" A="255"/>

    <Color x:Key="AppAlter1Color" R="44" G="168" B="23" A="255"/>
    <Color x:Key="AppAlter1LightColor" R="100" G="197" B="84" A="255"/>
    <Color x:Key="AppAlter1LightestColor" R="170" G="226" B="161" A="255"/>

    <Color x:Key="AppAlter2Color" R="25" G="172" B="182" A="255"/>
    <Color x:Key="AppAlter2LightColor" R="88" G="199" B="206" A="255"/>
    <Color x:Key="AppAlter2LightestColor" R="164" G="226" B="231" A="255"/>

    <Color x:Key="AppSecondaryColor" R="128" G="128" B="128" A="255"/>
    


    <SolidColorBrush x:Key="AppBaseBrush" Color="{StaticResource AppBaseColor}"/>
    <SolidColorBrush x:Key="AppSecondaryBrush" Color="{StaticResource AppSecondaryColor}"/>
    <SolidColorBrush x:Key="AppBaseLightestBrush" Color="{StaticResource AppBaseLightestColor}" />

    <SolidColorBrush x:Key="AppAlter1Brush" Color="{StaticResource AppAlter1Color}"/>
    <SolidColorBrush x:Key="AppAlter1LightestBrush" Color="{StaticResource AppAlter1LightestColor}"/>

    <SolidColorBrush x:Key="AppAlter2Brush" Color="{StaticResource AppAlter2Color}"/>
    <SolidColorBrush x:Key="AppAlter2LightestBrush" Color="{StaticResource AppAlter2LightestColor}"/>
    
    

    <!--Common-->
    <Color x:Key="Gray2">#FF7F7F7F</Color>


    <BooleanToVisibilityConverter x:Key="boolToVis"/>


    <Style TargetType="{x:Type Button}" x:Key="logoutButton">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Rectangle Name="Background" Fill="{StaticResource AppBaseBrush}"/>
                        <TextBlock Text="{TemplateBinding Content}" Name="Text" HorizontalAlignment="Right" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="Text" Property="Foreground" Value="LightGray"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <ControlTemplate x:Key="ImageButtonTemplate" TargetType="{x:Type ModernControls:ImageButton}">
        <Grid x:Name="Grid" Background="{StaticResource AppSecondaryBrush}">
            <Border 
        x:Name="Background" 
        Background="{TemplateBinding Background}" 
        BorderBrush="{TemplateBinding BorderBrush}" 
        BorderThickness="{TemplateBinding BorderThickness}" 
        CornerRadius="3" 
        Visibility="{Binding BorderVisibility, RelativeSource={RelativeSource TemplatedParent}}"/>
            <StackPanel 
        Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                <Image x:Name="ButtonImage" 
               Source="{Binding NormalImage, RelativeSource={RelativeSource TemplatedParent}}" 
               ToolTip="{TemplateBinding ToolTip}" Stretch="UniformToFill" Margin="8" />
                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" 
                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </StackPanel>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter TargetName="ButtonImage" Property="Source" Value="{Binding HoverImage, RelativeSource={RelativeSource TemplatedParent}}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
                <Setter TargetName="ButtonImage" Property="Source" Value="{Binding PressedImage, RelativeSource={RelativeSource TemplatedParent}}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter TargetName="ButtonImage" Property="Source" Value="{Binding DisabledImage, RelativeSource={RelativeSource TemplatedParent}}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="{x:Type ModernControls:ImageButton}" BasedOn="{x:Null}">
        <Setter Property="BorderThickness" Value="3"/>
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="Background" Value="{DynamicResource ButtonBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrush}" />
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="Template" Value="{StaticResource ImageButtonTemplate}" />
    </Style>

    <Style x:Key="ExitButtonStyle" TargetType="{x:Type ModernControls:ImageButton}" BasedOn="{StaticResource {x:Type ModernControls:ImageButton}}">
        <Setter Property="NormalImage" Value="/ModernControls;component/Images/closeNormal.png"/>
        <Setter Property="HoverImage"  Value="/ModernControls;component/Images/closeHover.png" />
        <!--<Setter Property="ToolTip" Value="Kilépés"/>-->
    </Style>

    <Style x:Key="MinimalizeButtonStyle" TargetType="{x:Type ModernControls:ImageButton}" BasedOn="{StaticResource {x:Type ModernControls:ImageButton}}">
        <Setter Property="NormalImage" Value="/ModernControls;component/Images/minimwindNormal.png"/>
        <Setter Property="HoverImage"  Value="/ModernControls;component/Images/minimwindHover.png" />
        <!--<Setter Property="ToolTip" Value="Minimalizálás"/>-->
    </Style>

    <Style x:Key="WindowStateButtonStyle" TargetType="{x:Type ModernControls:ImageButton}" BasedOn="{StaticResource {x:Type ModernControls:ImageButton}}">
        <Setter Property="NormalImage" Value="/ModernControls;component/Images/normwindNormal.png"/>
        <Setter Property="HoverImage" Value="/ModernControls;component/Images/normwindHover.png" />
        <!--<Setter Property="ToolTip" Value=""/>-->
    </Style>

    <Style TargetType="{x:Type TextBlock}">
        <Setter Property="FontFamily" Value="Segoe UI" />
        <Setter Property="Margin" Value="2"/>
    </Style>
    <Style TargetType="{x:Type Label}">
        <Setter Property="FontFamily" Value="Segoe UI" />
        <Setter Property="Margin" Value="2"/>
    </Style>

    <LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#F3F3F3" Offset="0"/>
        <GradientStop Color="#EBEBEB" Offset="0.5"/>
        <GradientStop Color="#DDDDDD" Offset="0.5"/>
        <GradientStop Color="#CDCDCD" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
    <Geometry x:Key="DownArrowGeometry">M 0 0 L 3.5 4 L 7 0 Z</Geometry>
    <Style x:Key="ComboBoxReadonlyToggleButton" TargetType="{x:Type ToggleButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" SnapsToDevicePixels="true">
                        <Grid HorizontalAlignment="Right" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
                            <Path x:Name="Arrow" Data="{StaticResource DownArrowGeometry}" Fill="Black"  HorizontalAlignment="Center" Margin="3,1,0,0" VerticalAlignment="Center"/>
                        </Grid>
                    </Microsoft_Windows_Themes:ButtonChrome>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Fill" TargetName="Arrow" Value="Red"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Borderless window-->
    <Style x:Key="MetroWindowStyle" TargetType="{x:Type Window}">
        <Setter Property="shell:WindowChrome.WindowChrome">
            <Setter.Value>
                <shell:WindowChrome
                        ResizeBorderThickness="6"
                        CaptionHeight="0"
                        CornerRadius="0"
                        GlassFrameThickness="0,0,0,1"/>
            </Setter.Value>
        </Setter>
        <Setter Property="WindowStyle" Value="SingleBorderWindow" />
        <Setter Property="ResizeMode" Value="CanResizeWithGrip" />
        <Setter Property="Template" Value="{DynamicResource MainWindowControlTemplate}"/>
    </Style>

    <ControlTemplate x:Key="MainWindowControlTemplate" TargetType="{x:Type Window}">
        <Grid>
            <ContentPresenter Margin="0"  Content="{TemplateBinding Content}"/>
        </Grid>
    </ControlTemplate>



    <Style x:Key="ComboBoxStyle" TargetType="{x:Type ComboBox}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBox}">
                    <Grid x:Name="MainGrid" SnapsToDevicePixels="True">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
                        </Grid.ColumnDefinitions>
                        <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
                            <Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=MainGrid}">
                                <Border x:Name="DropDownBorder" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
                                    <ScrollViewer x:Name="DropDownScrollViewer">
                                        <Grid RenderOptions.ClearTypeHint="Enabled">
                                            <Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
                                                <Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=DropDownBorder}" Height="{Binding ActualHeight, ElementName=DropDownBorder}" Width="{Binding ActualWidth, ElementName=DropDownBorder}"/>
                                            </Canvas>
                                            <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                        </Grid>
                                    </ScrollViewer>
                                </Border>
                            </Microsoft_Windows_Themes:SystemDropShadowChrome>
                        </Popup>
                        <ToggleButton BorderBrush="{TemplateBinding BorderBrush}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxReadonlyToggleButton}" Background="White"/>
                        <ContentPresenter ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Content="{TemplateBinding SelectionBoxItem}" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="false" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" Value="#FFF4F4F4"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--<Style x:Key="{x:Type ProgressBar}" TargetType="{x:Type ProgressBar}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ProgressBar}">
                    <Grid MinHeight="14" Background="LightGray">
                        <Border x:Name="PART_Track" CornerRadius="1" BorderThickness="1">
                            <Border.BorderBrush>
                                <SolidColorBrush Color="{DynamicResource BorderMediumColor}" />
                            </Border.BorderBrush>
                        </Border>
                        <Border x:Name="PART_Indicator" CornerRadius="1" BorderThickness="1" HorizontalAlignment="Left" Background="DarkGray" Margin="0,0,0,0">
                            <Border.BorderBrush>
                                <SolidColorBrush Color="{DynamicResource BorderLightColor}" />
                            </Border.BorderBrush>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>-->

    <Color x:Key="BorderLightColor">#FFCCCCCC</Color>
    <Color x:Key="BorderMediumColor">#FF888888</Color>

    <Style x:Key="{x:Type Button}" TargetType="{x:Type Button}" x:Name="SimpleButtonStyle">
        <!--<Setter Property="Height" Value="40" />-->
        <Setter Property="Margin" Value="5"/>
        <Setter Property="Template">
            <Setter.Value>
                <!--<ControlTemplate TargetType="{x:Type Button}">
                        <Grid Background="Transparent">
                            <Border BorderBrush="Black" BorderThickness="1,1,1,1" >
                            <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Content" Margin="12,2,12,2"
				                        TextBlock.FontFamily="Segoe WP Light" TextBlock.FontSize="12" />
                            </Border>
                        </Grid>                
                    </ControlTemplate>-->

                <ControlTemplate TargetType="Button">
                    <Border Name="RootElement">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup Name="CommonStates">
                                <VisualState Name="Normal" />
                                <!--<Storyboard>
                                    <ColorAnimation Storyboard.TargetName="BorderBrush" Storyboard.TargetProperty="Color" To="White" Duration="00:00:00.3"/>
                                    <ColorAnimation Storyboard.TargetName="FontColor"  Storyboard.TargetProperty="Color" To="Black" Duration="00:00:00.3" />
                                </Storyboard>-->
                                <VisualState Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="BorderBrush"  Storyboard.TargetProperty="Color"  To="{StaticResource AppBaseColor}" Duration="00:00:00.3"/>
                                        <ColorAnimation Storyboard.TargetName="FontColor"  Storyboard.TargetProperty="Color" To="White" Duration="00:00:00.3" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState Name="Pressed">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="BorderBrush"  Storyboard.TargetProperty="Color" To="Transparent" Duration="00:00:00.3"/>
                                        <ColorAnimation Storyboard.TargetName="FontColor"  Storyboard.TargetProperty="Color" To="{StaticResource AppBaseColor}" Duration="00:00:00.3"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState Name="Disabled">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="BorderBrush" Storyboard.TargetProperty="Color" To="LightGray" Duration="00:00:00.3"/>
                                        <ColorAnimation Storyboard.TargetName="FontColor" Storyboard.TargetProperty="Color" To="DarkGray" Duration="00:00:00.3"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>


                        <Grid Background="Transparent" >
                            <Border BorderBrush="Black" BorderThickness="1,1,1,1">
                                <Border.Background>
                                    <SolidColorBrush x:Name="BorderBrush" Color="White"/>
                                </Border.Background>

                                <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Content" 
				                        TextBlock.FontFamily="Segoe UI" TextBlock.FontSize="{TemplateBinding FontSize}">
                                    <TextBlock.Foreground>
                                        <SolidColorBrush x:Name="FontColor" Color="Black"/>
                                    </TextBlock.Foreground>
                                </ContentPresenter>
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type ToggleButton}" TargetType="{x:Type ToggleButton}">
        <!--<Setter Property="Height" Value="40" />
        <Setter Property="Margin" Value="5"/>-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Border Name="RootElement">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup Name="CommonStates">
                                <VisualState Name="Normal" />
                                <!--<Storyboard>
                                    <ColorAnimation Storyboard.TargetName="BorderBrush" Storyboard.TargetProperty="Color" To="White" Duration="00:00:00.3"/>
                                    <ColorAnimation Storyboard.TargetName="FontColor"  Storyboard.TargetProperty="Color" To="Black" Duration="00:00:00.3" />
                                </Storyboard>-->
                                <VisualState Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="BorderBrush"  Storyboard.TargetProperty="Color"  To="#FFFFB958" Duration="00:00:00.2"/>
                                        <ColorAnimation Storyboard.TargetName="FontColor"  Storyboard.TargetProperty="Color" To="White" Duration="00:00:00.2" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState Name="Checked">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="BorderBrush"  Storyboard.TargetProperty="Color" To="#FFFFB958" Duration="00:00:00.2"/>
                                        <ColorAnimation Storyboard.TargetName="FontColor"  Storyboard.TargetProperty="Color" To="White" Duration="00:00:00.2"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState Name="Unchecked">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="BorderBrush" Storyboard.TargetProperty="Color" To="White" Duration="00:00:00.2"/>
                                        <ColorAnimation Storyboard.TargetName="FontColor" Storyboard.TargetProperty="Color" To="White" Duration="00:00:00.2"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>


                        <Grid Background="Transparent" >
                            <Border BorderBrush="Black" BorderThickness="1,1,1,1">
                                <Border.Background>
                                    <SolidColorBrush x:Name="BorderBrush" Color="White"/>
                                </Border.Background>

                                <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Content" 
				                        TextBlock.FontFamily="Segoe UI" TextBlock.FontSize="{TemplateBinding FontSize}">
                                    <TextBlock.Foreground>
                                        <SolidColorBrush x:Name="FontColor" Color="Black"/>
                                    </TextBlock.Foreground>
                                </ContentPresenter>
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="TabItem" x:Key="TabControlItemContainerStyle">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TabItem">
                    <Grid x:Name="TabItemGrid">
                        <StackPanel Orientation="Horizontal">
                            <ContentPresenter x:Name="ContentSite" 
                                                                  VerticalAlignment="Center" 
                                                                  HorizontalAlignment="Center" 
                                                                  ContentSource="Header" 
                                                                  Margin="12,2,12,2"
				                                                  TextBlock.FontFamily="Arial" 
                                                                  TextBlock.FontSize="18" 
                                                                  SnapsToDevicePixels="True">
                            </ContentPresenter>
                        </StackPanel>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="ContentSite" Property="TextBlock.Foreground" Value="White" />
                            <Setter TargetName="ContentSite" Property="TextBlock.FontWeight" Value="ExtraBold" />
                            <Setter TargetName="TabItemGrid" Property="Background" Value="{StaticResource AppBaseBrush}" />
                        </Trigger>
                        <Trigger Property="IsSelected" Value="False">
                            <Setter TargetName="ContentSite" Property="TextBlock.Foreground" Value="DarkGray" />
                            <Setter TargetName="ContentSite" Property="TextBlock.FontWeight" Value="UltraLight" />
                            <Setter TargetName="TabItemGrid" Property="Background" Value="White" />
                        </Trigger>
                    </ControlTemplate.Triggers>


                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid Margin="3" VerticalAlignment="Center" HorizontalAlignment="Center">
                        <Grid.RowDefinitions>
                            <RowDefinition></RowDefinition>
                            <RowDefinition Height="Auto"></RowDefinition>
                        </Grid.RowDefinitions>
                        <TextBlock Text="{Binding Title}" Grid.Row="1" HorizontalAlignment="Center"></TextBlock>
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid DataContext="{Binding}">
                        <ContentPresenter Content="{Binding Content}" Margin="-5,0,-5,-5"/>
                        <!--<Grid Background="#11000000" Visibility="{Binding Content.DataContext.IsBusy, Converter={StaticResource boolToVis}}">
                            <ProgressBar IsIndeterminate="{Binding Content.DataContext.IsBusy}" Height="20" Width="400">
                                <ProgressBar.Effect>
                                    <DropShadowEffect BlurRadius="30" Opacity="0.6" />
                                </ProgressBar.Effect>
                            </ProgressBar>
                            <TextBlock Text="{Binding Content.DataContext.IsBusyText}" HorizontalAlignment="Center" VerticalAlignment="Center" Background="Transparent"/>
                        </Grid>-->
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- fugging Scrollbars -->
    <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid x:Name="Root" Margin="0,-5,0,0">
            <Grid.Resources>
                <ControlTemplate x:Key="RepeatButtonTemplate" TargetType="RepeatButton">
                    <Grid x:Name="Root" Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="HorizontalIncrementTemplate" TargetType="RepeatButton">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="HoverPath">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Blur">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard/>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Root">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Path Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z " Height="6" Stretch="Uniform" Width="4">
                            <Path.Fill>
                                <SolidColorBrush Color="{StaticResource Gray2}"/>
                            </Path.Fill>
                        </Path>
                        <Path x:Name="HoverPath" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z " Height="6" Stretch="Uniform" Width="4" UseLayoutRounding="False" Opacity="0" Margin="1,1,0,0">
                            <Path.Fill>
                                <SolidColorBrush Color="Black"/>
                            </Path.Fill>
                        </Path>
                        <Path x:Name="Blur" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z " Height="6" Stretch="Uniform" Width="4" UseLayoutRounding="False" Opacity="0" Margin="1,1,0,0">
                            <Path.Effect>
                                <BlurEffect/>
                            </Path.Effect>
                            <Path.Fill>
                                <SolidColorBrush Color="Black"/>
                            </Path.Fill>
                        </Path>
                        <Rectangle x:Name="DisabledElement" Fill="White" Opacity="0" RadiusY="2" RadiusX="2"/>
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="HorizontalDecrementTemplate" TargetType="RepeatButton">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="HoverPath">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Blur">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard/>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Root">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Path Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z " Height="6" Stretch="Uniform" Width="4">
                            <Path.Fill>
                                <SolidColorBrush Color="{StaticResource Gray2}"/>
                            </Path.Fill>
                        </Path>
                        <Path x:Name="HoverPath" Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z " Height="6" Stretch="Uniform" Width="4" UseLayoutRounding="False" Opacity="0" Margin="0,1,0,0">
                            <Path.Fill>
                                <SolidColorBrush Color="Black"/>
                            </Path.Fill>
                        </Path>
                        <Path x:Name="Blur" Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z " Height="6" Stretch="Uniform" Width="4" UseLayoutRounding="False" Opacity="0" Margin="0,1,0,0">
                            <Path.Effect>
                                <BlurEffect/>
                            </Path.Effect>
                            <Path.Fill>
                                <SolidColorBrush Color="Black"/>
                            </Path.Fill>
                        </Path>
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="HorizontalThumbTemplate" TargetType="Thumb">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PressedRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ThumbVisual">
                                            <SplineDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="ThumbVisual" Margin="0,1,0,1">
                            <Rectangle x:Name="Background" StrokeThickness="1" Fill="LightGray" />
                            <Rectangle x:Name="MouseOverRectangle" StrokeThickness="1" Opacity="0" Fill="Black" />
                            <Rectangle x:Name="PressedRectangle" StrokeThickness="1" Opacity="0" Fill="Black" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Grid.Resources>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver"/>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root">
                                <SplineDoubleKeyFrame KeyTime="0" Value="0.5"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="HorizontalRoot" Height="11" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Border BorderThickness="0,0,0,1" Grid.RowSpan="1" Margin="0,0,0,-1" Grid.ColumnSpan="5" Visibility="Collapsed" >
                    <Border.BorderBrush>
                        <SolidColorBrush Color="LightGray"/>
                    </Border.BorderBrush>
                </Border>
                <RepeatButton x:Name="HorizontalSmallDecrease" Command="ScrollBar.LineLeftCommand" Width="16" IsTabStop="False" Interval="50" Margin="1" Grid.Column="0" Template="{DynamicResource HorizontalDecrementTemplate}"/>
                <Track x:Name="PART_Track" MinWidth="60" IsDirectionReversed="False" Grid.Column="1">
                    <Track.Resources>
                        <System:Double x:Key="{x:Static SystemParameters.VerticalScrollBarButtonHeightKey}">
                            100
                        </System:Double>
                    </Track.Resources>
                    <Track.DecreaseRepeatButton>
                        <RepeatButton x:Name="HorizontalLargeDecrease" Command="ScrollBar.PageLeftCommand" IsTabStop="False" Interval="50" Template="{DynamicResource RepeatButtonTemplate}"/>
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                        <Thumb MinWidth="60" Template="{DynamicResource HorizontalThumbTemplate}"/>
                    </Track.Thumb>
                    <Track.IncreaseRepeatButton>
                        <RepeatButton x:Name="HorizontalLargeIncrease" Command="ScrollBar.PageRightCommand" IsTabStop="False" Interval="50" Template="{DynamicResource RepeatButtonTemplate}"/>
                    </Track.IncreaseRepeatButton>
                </Track>
                <RepeatButton x:Name="HorizontalSmallIncrease" Command="ScrollBar.LineRightCommand" Width="16" IsTabStop="False" Interval="50" Margin="1" Grid.Column="2" Template="{DynamicResource HorizontalIncrementTemplate}"/>
            </Grid>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid x:Name="Root">
            <Grid.Resources>
                <ControlTemplate x:Key="RepeatButtonTemplate" TargetType="RepeatButton">
                    <Grid x:Name="Root" Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="VerticalIncrementTemplate" TargetType="RepeatButton">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="HoverPath">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Blur">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard/>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Root">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Path Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z " Height="4" Stretch="Uniform" Width="6">
                            <Path.Fill>
                                <SolidColorBrush x:Name="ButtonColor" Color="LightGray"/>
                            </Path.Fill>
                        </Path>
                        <Path x:Name="HoverPath" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z " Height="4" Stretch="Uniform" Width="6" UseLayoutRounding="False" Opacity="0" Margin="1,0,0,0">
                            <Path.Fill>
                                <SolidColorBrush Color="Black"/>
                            </Path.Fill>
                        </Path>
                        <Path x:Name="Blur" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z " Height="4" Stretch="Uniform" Width="6" UseLayoutRounding="False" Opacity="0" Margin="1,0,0,0">
                            <Path.Effect>
                                <BlurEffect/>
                            </Path.Effect>
                            <Path.Fill>
                                <SolidColorBrush Color="Black"/>
                            </Path.Fill>
                        </Path>
                        <Rectangle x:Name="DisabledElement" Fill="White" Opacity="0" RadiusY="2" RadiusX="2"/>
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="VerticalDecrementTemplate" TargetType="RepeatButton">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="HoverPath">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Blur">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard/>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Root">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.5"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="Background" Fill="Transparent" Opacity="0" RadiusY="2" RadiusX="2" StrokeThickness="1"/>
                        <Rectangle x:Name="BackgroundMouseOver" Fill="#FF5C9EBC" Opacity="0" RadiusY="2" RadiusX="2" />
                        <Rectangle x:Name="BackgroundPressed" Fill="#FF5C9EBC" Opacity="0" RadiusY="2" RadiusX="2" />
                        <Rectangle x:Name="BackgroundGradient" Fill="#00FFFFFF" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="Black" StrokeThickness="1"/>
                        <Rectangle x:Name="Highlight" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FF5C9EBC" StrokeThickness="1"/>
                        <Path Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z " Height="4" Stretch="Uniform" Width="6">
                            <Path.Fill>
                                <SolidColorBrush Color="LightGray"/>
                            </Path.Fill>
                        </Path>
                        <Path x:Name="HoverPath" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z " Height="4" Stretch="Uniform" Width="6" UseLayoutRounding="False" Opacity="0" Margin="1,0,0,0">
                            <Path.Fill>
                                <SolidColorBrush Color="Black"/>
                            </Path.Fill>
                        </Path>
                        <Path x:Name="Blur" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z " Height="4" Stretch="Uniform" Width="6" UseLayoutRounding="False" Opacity="0" Margin="1,0,0,0">
                            <Path.Effect>
                                <BlurEffect/>
                            </Path.Effect>
                            <Path.Fill>
                                <SolidColorBrush Color="Black"/>
                            </Path.Fill>
                        </Path>
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="VerticalThumbTemplate" TargetType="Thumb">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>

                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PressedRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ThumbVisual">
                                            <SplineDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="ThumbVisual" Margin="1,0,1,0">
                            <Rectangle x:Name="Background" StrokeThickness="1" Fill="LightGray" />
                            <Rectangle x:Name="MouseOverRectangle" StrokeThickness="1" Opacity="0" Fill="Black" />
                            <Rectangle x:Name="PressedRectangle" StrokeThickness="1" Opacity="0" Fill="Black" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Grid.Resources>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver"/>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root">
                                <SplineDoubleKeyFrame KeyTime="0" Value="0.5"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid x:Name="VerticalRoot"  Width="11">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Border BorderThickness="0,0,1,0" Margin="0,0,-1,0" Grid.RowSpan="5" Visibility="Collapsed" >
                    <Border.BorderBrush>
                        <SolidColorBrush Color="LightGray"/>
                    </Border.BorderBrush>
                </Border>
                <RepeatButton x:Name="VerticalSmallDecrease" Command="ScrollBar.LineUpCommand" Height="16" IsTabStop="False" Interval="50" Margin="1" Grid.Row="0" Template="{DynamicResource VerticalDecrementTemplate}"/>
                <Track x:Name="PART_Track" MinHeight="60" IsDirectionReversed="true" Grid.Row="1">
                    <Track.Resources>
                        <System:Double x:Key="{x:Static SystemParameters.VerticalScrollBarButtonHeightKey}">
                            100
                        </System:Double>
                    </Track.Resources>
                    <Track.DecreaseRepeatButton>
                        <RepeatButton x:Name="VerticalLargeDecrease" Command="ScrollBar.PageUpCommand" IsTabStop="False" Interval="50" Template="{DynamicResource RepeatButtonTemplate}"/>
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                        <Thumb MinHeight="60" Template="{DynamicResource VerticalThumbTemplate}"/>
                    </Track.Thumb>
                    <Track.IncreaseRepeatButton>
                        <RepeatButton x:Name="VerticalLargeIncrease" Command="ScrollBar.PageDownCommand" IsTabStop="False" Interval="50" Template="{DynamicResource RepeatButtonTemplate}"/>
                    </Track.IncreaseRepeatButton>
                </Track>
                <RepeatButton x:Name="VerticalSmallIncrease" Command="ScrollBar.LineDownCommand" Height="16" IsTabStop="False" Interval="50" Margin="1" Grid.Row="2" Template="{DynamicResource VerticalIncrementTemplate}"/>
            </Grid>
        </Grid>
    </ControlTemplate>

    <!-- Style for overall  ScrollBar -->
    <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="Width" Value="Auto"/>
                <Setter Property="Height" Value="8" />
                <Setter Property="Template"
						Value="{DynamicResource HorizontalScrollBar}" />
            </Trigger>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="Width" Value="12"/>
                <Setter Property="Height" Value="Auto" />
                <Setter Property="Template"
						Value="{DynamicResource VerticalScrollBar}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type TabControl}" >
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid KeyboardNavigation.TabNavigation="Local">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <TabPanel 
                                                  Name="HeaderPanel"
                                                  Grid.Row="0"
                                                  Panel.ZIndex="1" 
                                                  Margin="0,0,4,-1" 
                                                  IsItemsHost="True"
                                                  KeyboardNavigation.TabIndex="1"
                                                  Background="Transparent" />
                        <Border 
                                                  Name="Border" 
                                                  Grid.Row="1" 
                                                  Background="White" 
                                                  BorderBrush="Transparent" 
                                                  BorderThickness="1" 
                                                  CornerRadius="2" 
                                                  KeyboardNavigation.TabNavigation="Local"
                                                  KeyboardNavigation.DirectionalNavigation="Contained"
                                                  KeyboardNavigation.TabIndex="2" >
                            <ContentPresenter 
                                                                Name="PART_SelectedContentHost"
                                                                Margin="4"
                                                                ContentSource="SelectedContent" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="Gray" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="Transparent" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>

   

</ResourceDictionary>
